program tstblas
	implicit none
	double precision, allocatable :: A(:,:), B(:,:), C(:,:)
	integer :: nrow = 2, ncol = 2
	integer :: i, j, k

	allocate( A(nrow, ncol) )
	allocate( B(nrow, ncol) )
	allocate( C(nrow, ncol) )

	do i = 1, nrow
		do j = 1, ncol
			A(i, j) = 2D0
			B(i, j) = 1D0
			C(i, j) = 0D0
		enddo
	enddo

	do i = 1, nrow
		do j = 1, ncol
			write(*,*) C(i,j)
		enddo
	enddo

	call DGEMM( 'N', 'N', nrow, ncol, ncol, 1D0, A, nrow, B, nrow, 0D0, C, nrow )

	do i = 1, nrow
		do j = 1, ncol
			write(*,*) C(i,j)
		enddo
	enddo

	deallocate( A )
	deallocate( B )
	deallocate( C )

endprogram
